<!--# 
layout("/layout/default.html",{"menu":["cogs","cog"],"breadcrumbs":[{"name":"网站配置"}]}){ 
 #-->
<div class="tabbable">
	<ul class="nav nav-tabs padding-12 tab-color-blue background-blue" id="myTab4">
		<li class="active"><a data-toggle="tab" href="#about">公司介绍</a></li>

		<li><a data-toggle="tab" href="#contact">联系方式</a></li>

		<li><a data-toggle="tab" href="#icp">备案信息</a></li>

		<li><a data-toggle="tab" href="#hire">人才招聘</a></li>

		<li><a data-toggle="tab" href="#args">参数设置</a></li>

	</ul>

	<div class="tab-content">
		<div id="about" class="tab-pane active">
			<textarea rows="40" class="form-control" id="aboutUs" name="aboutUs" data-key='${config("about")}'>${obj.data.configs['about.us']!}</textarea>

			<div class="space-6"></div>

			<div class="pull-right" style="margin-right: 45px">
				<button type="button" class="btn btn-sm btn-primary" onclick="saveAbout()">
					<i class="fa fa-save"></i> 提交
				</button>
				<button class="btn btn-sm btn-default btn-back">
					<i class="fa fa-undo"></i> 返回
				</button>
			</div>
		</div>

		<div id="contact" class="tab-pane">
			<form class="form-horizontal" role="form">

				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1-1"> 地址 </label>

					<div class="col-sm-9">
						<div class="input-group" onclick="showMap()">
							<input class="form-control" id="address" name="address" type="text" disabled="disabled" placeholder="请选择公司地址" data-type='required' data-error='请选择公司地址'> <span
								class="input-group-btn">
								<button class="btn btn-sm btn-primary" type="button">
									<i class="ace-icon fa fa-map-marker bigger-110"></i>
								</button>
							</span> <input type="hidden" id="province" name="province"> <input type="hidden" id="city" name="city"> <input type="hidden" id="district" name="district">
							<input type="hidden" id="longitude" name="longitude"> <input type="hidden" id="latitude" name="latitude">
						</div>
					</div>
				</div>

				<div class="space-4"></div>

				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1-1"> 邮编 </label>

					<div class="col-sm-9">
						<input type="text" id="form-field-1-1" placeholder="请填写邮政编码" class="form-control">
					</div>
				</div>

				<div class="space-4"></div>

				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1-1"> 电话 </label>

					<div class="col-sm-9">
						<input type="text" id="form-field-1-1" placeholder="请填写联系电话" class="form-control">
					</div>
				</div>

				<div class="space-4"></div>

				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1-1"> 传真</label>

					<div class="col-sm-9">
						<input type="text" id="form-field-1-1" placeholder="请填写传真号码" class="form-control">
					</div>
				</div>

				<div class="space-4"></div>

				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1-1"> 网址 </label>

					<div class="col-sm-9">
						<input type="text" id="form-field-1-1" placeholder="请填写网址" class="form-control">
					</div>
				</div>

				<div class="space-4"></div>

				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1-1"> 邮箱 </label>

					<div class="col-sm-9">
						<input type="text" id="form-field-1-1" placeholder="请填写联系邮箱" class="form-control">
					</div>
				</div>

				<div class="space-4"></div>

			</form>
		</div>

		<div id="icp" class="tab-pane">备案信息</div>

		<div id="hire" class="tab-pane">人才招聘</div>

		<div id="args" class="tab-pane">参数设置</div>

	</div>
</div>
<script type="text/javascript">
	var aboutEditor;
	KindEditor.ready(function(K) {
		aboutEditor = K.create('textarea[name="aboutUs"]', {
			uploadJson : getRootPath() + '/kind/upload'
		});
	});

	function showMap() {
		baiduMap(function(result) {
			$('#address').val(result.address);
			$('#province').val(result.addressComponents.province);
			$('#city').val(result.addressComponents.city);
			$('#district').val(result.addressComponents.district);
			$('#longitude').val(result.point.lng);
			$('#latitude').val(result.point.lat);
		})
	}

	function saveAbout() {
		var para = {};
		para[$('textarea[name="aboutUs"]').data('key')] = aboutEditor.html();
		console.log(para)
		$.post(getRootPath() + '/admin/config/save', para, function(result) {
			if (result.operationState == 'SUCCESS') {
				showMessage("设置成功");
			} else {
				showMessage(result.data.reason);
			}
		}, 'json')
	}
</script>
<!--# } #-->
